
var _XheList;

const Status = [
    { "key": "1", "value": "使用", "defaulted": "true" },
    { "key": "0", "value": "作废" }
];

$(function () {
    bind();
    search();
});

var bind = function () {
    try {
        document.getElementById("spn_view_title").innerHTML = PROJECTNAME;
        Template.init("temp_publish");
        OptionUtil.bind("ddl_S_Status", "key", "value", Status, false, null, "");
    }
    catch (e) { }
}

var init = function () {

    _XheList = new XheList();
    //_SearchModel.Methed = "DataCenterGet_1_0";
    _XheList.model.TableID = "tbl_Data";
    _XheList.model.ModalID = "div_Modal";
    _XheList.model.Title = "";
    _XheList.model.Table = "t_data_publish";
    _XheList.model.SortName = "publishid";
    _XheList.model.SortOrder = "desc";
    _XheList.model.PrimaryKey = "publishid";
    _XheList.model.Button.Info = "浏览";
    _XheList.model.Button.Show = "编辑";
    _XheList.model.Checked = false;
    _XheList.model.Number = true;
};

// 展示列表数据
var search = function () {

    try {
        init();

        _XheList.model.Columns = [
            ["publishname", "模板名称", "15", "", "C", "", true],
            ["publishremark", "模板描述", "35", "", "C", "", true],
            ["publishcreatetime", "创建时间", "12", "", "D", "", true],
            ["publishusername", "创建人", "10", "", "C", "", true],
            ["publishstatus", "状态", "10", "", "C", Status, true],
            ["publishid", "操作", "10", "null", "I", "", true]
        ];

        //获取页面参数
        var vUrlParams = HttpUtil.getUrlParams();

        if (vUrlParams != undefined && vUrlParams != null) {
            let userID = vUrlParams.params1;

            _XheList.model.Filter = [
                ["publishuserid", "A", "EQ", "C", userID]
            ];
        }

        _XheList.search();
    } catch (e) {
        alert(e);
    }
};

var info = function (model, value, row, index) {
    try {


        window.open("../../index/pages/frame.html?target=" + row.publishid);

    }
    catch (e) {
        alert(e);
    }
};


var show = function (model, value, row, index) {
    try {

        if (row.publishid != undefined && row.publishid != null) {
            jumpUrl("UI-HBGJ", row.publishid, "publish");
        }
    }
    catch (e) {
        alert(e);
    }
};

var save = function () {
    try {

        _XheList.edit();
    }
    catch (e) {
        alert(e);
    }
}

















